package ywpt.service.system;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;

import ywpt.components.acegi.domain.Function;

public interface FunctionService {
	public abstract Function getFunctionById(Long id);

	public abstract List<Function> getAllFunctions();

	@SuppressWarnings("unchecked")
	public abstract List<Function> getFunctions(DetachedCriteria query);

	@SuppressWarnings("unchecked")
	public abstract List<Function> getFunctions(DetachedCriteria query, int pageSize, int startIndex);

	public abstract int getFunctionsCount(DetachedCriteria query);

	public abstract void saveFunction(Function user);

	public abstract void updateFunction(Function user);

	public abstract void removeFunction(String id);

	public abstract void addRoles(Function func, List<Long> roles);
	
	public abstract int[] removeRoles(Function func, Long[] ids);
	
	public abstract Function getFunctionByFunctionName(String functionName);

	@SuppressWarnings("unchecked")
	public abstract List getFunctionTree(Long parentId,List roles);
	
	@SuppressWarnings("unchecked")
	public abstract List getFunctionTree(Long parentId);
}